package cn.webrx.coll;/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */

import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * <p>Project: jse2204 - cn.webrx.coll.HashMap1
 * <p>Powered by webrx On 2022-09-19 17:44:40
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class HashMap1 {
    public static void main(String[] args) {
        Map<String,String> map = new HashMap<>();
        map.put("北京","李四");
        map.put("郑州","王五");
        map.put("北京","李丽");
        map.put("上海","李丽");
        System.out.println(map.size());
        System.out.println(map);

        //Map<String,cn.webrx.coll.Student> ms;

        Map<String, Set<String>> mss = new HashMap<>();
        mss.put("北京", new HashSet(List.of("李强","张三","张三","张三")));
        System.out.println(mss);

        //获取key集合
        Set<String> keys = map.keySet();

        //获取值集合
        Collection<String> values = map.values();


    }
}
